package 算法.其他算法;

public class JZ5替换空格 {
    public String replaceSpace (String s) {
        // write code here
        char[] chars = s.toCharArray();
        StringBuilder sb = new StringBuilder();
        for(char c : chars){
            if(c==' ')
                sb.append("%20");
            else
                sb.append(c);
        }
        return  sb.toString();
    }
}
